If you're in the same directory as the img file you're working with, you only need to pass in the token.
This creates a directory with the same name as the given token in which all the intermediate and final result files will be output to.
In [ ]:
from clarityviz import claritybase
token = 'Fear199'
source_directory = '/cis/home/alee/claritycontrol/code/data/raw'
# Initialize the claritybase object, the initial basis for all operations.
# After you initialize with a token and source directory, a folder will be created in your current directory
# with the token name, and all the output files will be stored there.
cb = claritybase(token, source_directory)
In [ ]:
cb.applyLocalEq()
cb.loadGeneratedNii()
In [ ]:
cb.calculatePoints(threshold = 0.9, sample = 0.1)
In [ ]:
cb.generate_plotly_html()
# savePoints generates the csv file of all the points in the graph.
cb.savePoints()
# plot3d calculates all the edges between the nodes.
cb.plot3d()
# graphmlconvert() creates a graphml file based on the nodes and edges file generated in plo3d.
cb.graphmlconvert()
Fear199: https://neurodatadesign.github.io/seelviz/reveal/html/clarityvizhtmls/Fear199plotly.html
Cocaine174: https://neurodatadesign.github.io/seelviz/reveal/html/Cocaine174localeq.html
Control181: https://neurodatadesign.github.io/seelviz/reveal/html/Control181localeq.html
After you finish generating all the files from claritybase, you have two options for more advanced analysis: the densitygraph module and the atlasregiongraph module
In [ ]:
from clarityviz import densitygraph
# Uses the same token before, must be in the same directory as before.
dg = densitygraph(token)
# generates a 3d plotly with color representations of density
dg.generate_density_graph()
# generates a heat map, essentially a legend, telling how many edges a certain color represents,
# with number of edges representing how dense a certain node clustering may be.
dg.generate_heat_map()
Fear199: https://neurodatadesign.github.io/seelviz/reveal/html/clarityvizhtmls/Fear199_density.html
Cocaine174: https://neurodatadesign.github.io/seelviz/reveal/html/graphmlhtmls/Cocaine174localeq.5000.graphml.html
Fear199: https://neurodatadesign.github.io/seelviz/reveal/html/clarityvizhtmls/Fear199heatmap.html
In [ ]:
from clarityviz import atlasregiongraph
regiongraph = atlasregiongraph(token)
regiongraph.generate_atlas_region_graph()